#!/usr/bin/python3
from flask import request
from flask import Flask
from flask import render_template
app = Flask(__name__)

#@app.route('/')
#def hello_world():
#    return 'hell world , i am cali!'

@app.route('/test',methods=['POST'])
def test():
    return 'post User'

@app.route('/userid',methods=["POST"])
def show_userid():
    return 'your name is {0} your password is {1}'.format(request.form['uid'],request.form['pwd'])
#app.add_url_rule('/userid/<int:user_id>',endpoint='show_userid',view_func=show_userid)
@app.route('/')
def item():
    return """<html>
            <body>
            <form method="POST" action="/login">
            <input type="text" name="username">
            <input type="submit" value="login">
            </form>
            </body> 
            </html>
"""
@app.route('/login')
def hi():
    #return 'your name is {}'.format(request.form['username'])
    return render_template('login.html')
if __name__ == '__main__':
    app.run(host='0.0.0.0',port=80,debug=True,threaded=True)
=============================================================
[root@localhost lianxi]# cat login.html 
<html>
<head>
	<title>login page</title>
</head>
<body>
	<form method="POST" action=/login>
		<input type="text" name="uid">
		<input type="password" name="pwd"> 
		<input type="submit" name="Login">
	</form>
</body>
</html>